package com.cash.lemoloan.statisticlib;


import android.app.Application;
import android.os.Handler;
import android.text.TextUtils;

import com.cash.lemoloan.networklib.Intetface.ResultInterface;
import com.cash.lemoloan.networklib.Utils.NetWorkUtils;
import com.cash.lemoloan.statisticlib.Utils.CommonUtil;
import com.cash.lemoloan.statisticlib.Utils.PreferencesUtil;

import org.json.JSONObject;

import java.util.HashMap;

public class StatisticApplication {
    private static Handler mainHandler;
    private static Application instance = null;
    public static void init(Application application){
        instance = application;
        mainHandler = new Handler();
        initGoogleId();
    }
    public static Handler getMainHandler(){
        return mainHandler;
    }
    public static Application getInstance(){
        return instance;
    }
    private static void initGoogleId(){
        String googleId = PreferencesUtil.getString(StatisticContant.GOOGLEID_KEY);
        if(TextUtils.isEmpty(googleId)){
            CommonUtil.initGoogleId();
        }else{
            StatisticContant.GOOGLEID = googleId;
        }
    }
}
